﻿<%@ Page Title="" Language="C#" MasterPageFile="~/GuestView.master" AutoEventWireup="true" CodeBehind="searchProducts.aspx.cs" Inherits="BestBuy.PageGuest.searchProducts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div class="container">
        <table width="100%">
            <tr>
                <td>
                    <div id="linkQuick" runat="server">
                        <a href="../Default.aspx">Home </a>> <a href="ListCategory.aspx">Product </a>>
                        <asp:Label ID="lbNameProductLinkHeader" runat="server"></asp:Label>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="pnEmtry" runat="server">
                        <asp:Label ID="lbGridViewEmtry" runat="Server"></asp:Label>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td class="td_right">
                    <asp:Panel ID="pnPhanTrang" runat="server">
                        <asp:LinkButton ID="lbtnBegin" runat="server" CssClass="pagePhanTrang" ToolTip="First"
                            Text="<<" OnClick="lbtnBegin_Click"></asp:LinkButton>
                        <asp:LinkButton ID="lbtnPre" runat="server" CssClass="pagePhanTrang" ToolTip="Previous"
                            Text="<" OnClick="lbtnPre_Click"></asp:LinkButton>
                        <asp:Label ID="lbPages" runat="Server" Text="Pages :"></asp:Label>
                        <asp:TextBox ID="txtTrangHienTai" CssClass="txtTrangHienTai" runat="server" Height="13px"
                            Width="50px" MaxLength="7">1</asp:TextBox>
                        <span class="canh_deu">/</span>
                        <asp:Label ID="lbTrang" runat="server"></asp:Label>
                        <asp:RegularExpressionValidator runat="server" ID="valNumbersOnly" CssClass="error"
                            ControlToValidate="txtTrangHienTai" Display="Dynamic" ErrorMessage="Just enter a positive integer."
                            ValidationExpression="(^(?=\d*[1-9])\d+$)">
                        </asp:RegularExpressionValidator>
                        <asp:LinkButton ID="lbtnNext" runat="server" CssClass="pagePhanTrang" ToolTip="Next"
                            Text=">" OnClick="lbtnNext_Click"></asp:LinkButton>
                        <asp:LinkButton ID="lbtnEnd" runat="server" CssClass="pagePhanTrang" ToolTip="Last"
                            Text=">>" OnClick="lbtnEnd_Click"></asp:LinkButton>
                        <asp:LinkButton ID="lbtnToi" CssClass="style_button" Style="margin-left: 5px; cursor: pointer;"
                            CausesValidation="True" runat="server" Text="Go" OnClick="lbtnToi_Click">
                        </asp:LinkButton>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="duongvien_pd">
                        <asp:GridView ID="gvListProducts" runat="server" HeaderStyle-CssClass="gridview_header"
                            CssClass="gv_product_catalogy" DataKeyNames="IDSanPham,TenSanPham,IDTaiKhoan" AutoGenerateColumns="False"
                            GridLines="None" PageSize="15" PagerSettings-FirstPageText="<<">
                            <Columns>
                                <asp:TemplateField HeaderText="Check All" HeaderStyle-Width="40">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkXoa" runat="server" />
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this, 'chkXoa');" runat="server"
                                            type="checkbox" name="All" style="color: White; margin: -4px 5px 0px 5px;" />All
                                    </HeaderTemplate>
                                    <HeaderStyle Width="40px"></HeaderStyle>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="100">
                                    <HeaderTemplate>
                                        Image</HeaderTemplate>
                                    <ItemTemplate>
                                        <a id="hlProduct" href='ProductDetail.aspx?pid=<%#Eval("IDSanPham") %>'>
                                            <asp:Image ID="image" runat="server" Width="100px" Height="100px" ImageUrl='<%# CheckHinhAnh(Eval("HinhAnh")) %>' />
                                        </a>
                                    </ItemTemplate>
                                    <ItemStyle Width="100px"></ItemStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="300">
                                    <HeaderTemplate>
                                        <asp:Button ID="btnHeaderContact" runat="server" CssClass="button_contact" 
                                            Text="Contact now" onclick="btnHeaderContact_Click" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a id="lbtnTitle" class="lbtnProduct" href='ProductDetail.aspx?pid=<%#Eval("IDSanPham")%>'><%#Eval("TenSanPham") %></a>
                                        <br />
                                        Min order:
                                        <asp:Label ID="lbMinOrder" runat="server" Text='<%#Eval("SoLuongDatToiThieu") %>'></asp:Label>
                                        <br />
                                        Place of Origin:
                                        <asp:Label ID="Label1" runat="server" Text='<%#Eval("NoiXuatXu") %>'></asp:Label>
                                        <br />
                                        Supplying Ability:
                                        <asp:Label ID="Label2" runat="server" Text='<%#Eval("KhaNangCungCap") %>'></asp:Label>
                                        <br />
                                        Payment Type:
                                        <asp:Label ID="Label3" runat="server" Text='<%#LoadPhuongThucThanhToan(Eval("PhuongThucThanhToan")) %>'></asp:Label>
                                        <br />
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                                    <ItemStyle Width="300px"></ItemStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-HorizontalAlign="Left">
                                    <HeaderTemplate>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <div style="margin-top: -20px;">
                                            <div style="margin: 0px 0px 0px 0px">
                                                <div style="margin-bottom: 0px">
                                                </div>
                                                <div style="margin: 0px; padding: 0px; border: 0px inset;">
                                                    <div style="display: none; text-align: justify;">
                                                        <p>
                                                            Product Details:
                                                            <%#Eval("ChiTietSanPham") %></p>
                                                    </div>
                                                    <img alt="" id="img_anhien" align="right" src="../Images/Layout/sortdesc.gif" title="More"
                                                        onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != ''){ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.src = '../Images/Layout/sortasc.gif';this.title='Less'; 
		                                            }
		                                            else 
		                                            { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.src = '../Images/Layout/sortdesc.gif';this.title='More'; }" />
                                                </div>
                                            </div>
                                        </div>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="150">
                                    <HeaderTemplate>
                                        <asp:Label ID="lbQuantity" runat="server" Text='<%#LoadCount() %>'></asp:Label>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        Country:
                                        <asp:Image ID="imgCounntry" runat="server" Style="vertical-align:top;" Height="16" Width="20" ImageUrl='<%# "~/Images/Flags/" + Eval("ThongTinTaiKhoan.QuocGia.TenQuocGia") + ".gif" %>'/> 
                                        <asp:Label ID="lbCountry" runat="server" Text='<%# Eval("ThongTinTaiKhoan.QuocGia.TenQuocGia") %>'></asp:Label>
                                        <br />
                                        Company: <asp:Label ID="lbOffline" runat="server" Text='<%# Eval("ThongTinTaiKhoan.CongTy.TenCongTy") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="150px"></ItemStyle>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="70">
                                    <HeaderTemplate>
                                        Page<asp:Label ID="lbCurrentPage" runat="server" Text='<%#LoadCurrentPage() %>'></asp:Label>
                                        of<asp:Label ID="lbTotalPage" runat="server" Text='<%#LoadTotalPage() %>'></asp:Label>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a id="btnContact" href='PageContactMessage.aspx?ml=1&pid=<%#Eval("IDSanPham") %>' class="button_contact">Contact</a>
                                    </ItemTemplate>
                                    <ItemStyle Width="70px"></ItemStyle>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle CssClass="gridview_header"></HeaderStyle>
                            <PagerSettings FirstPageText="&lt;&lt;"></PagerSettings>
                        </asp:GridView>
                    </div>
                </td>
            </tr>
        </table>
        <div style="height:200px"></div>
    </div>
</asp:Content>
